package com.zero.webapp;

import com.zero.servlet.ZeroRequest;
import com.zero.servlet.ZeroResponse;
import com.zero.servlet.ZeroServlet;

import java.util.List;
import java.util.Map;

public class MyServlet extends ZeroServlet {
    @Override
    public void doGet(ZeroRequest request, ZeroResponse response) throws Exception {
        String uri = request.getUri();
        String path = request.getPath();
        String method = request.getMethod();
        Map<String, List<String>> parameters = request.getParameters();
        String content = "uri=" + uri + "\n"
            + "path=" + path + "\n"
            + "method=" + method + "\n"
            + "parameters=" + parameters;
        response.write(content);
    }

    @Override
    public void doPost(ZeroRequest request, ZeroResponse response) throws Exception {
        doGet(request, response);
    }
}
